<template>
  <view>
    <image :src="pic1"></image>
    <button type="primary" :loading="false">按钮</button>
  </view>

  <view class="box" :class="{active:isActive}">v-bind指令</view>

  <view class="box" :style="{width:'300px',height:260+'px',fontSize:size+'px'}" :class="isActive?'active':''">内联样式
  </view>
</template>

<script setup>
  import { ref } from 'vue'
  const arrs = ref([
    '../../static/pic1.png',
    '../../static/pic2.png',
    '../../static/pic3.webp',
    '../../static/pic4.jpg'
  ])

  let i = 0
  setInterval(() => {
    pic1.value = arrs.value[i++ % 4]
    isActive.value = !isActive.value
    size.value += i
  }, 1000)

  const pic1 = ref('../../static/pic1.png')

  const isActive = ref(false)
  const size = ref(30)
</script>

<style lang="scss">
  .box {
    width: 200px;
    height: 200px;
    background-color: orange;
    font-size: 20px;
  }

  .active {
    background-color: green;
    color: #fff
  }
</style>